<template>
  <div>
    <ZgEdit
      ref="dialog"
      :columns="columns"
      :formulas="formulas"
      :inputClick="inputClick"
      validUrl=""
      saveUrl=""
      :view="view"
      @ok="$emit('ok')">
    </ZgEdit>
  </div>
</template>
<script>
export default {
  data () {
    return {
      view: {
        width: '60%',
        top: '3%',
        title: '新增'
      },
      columns: [
        { name: '授信名称', code: 'name', compType: '单行文本', isNeed: true, offset: 0, span: 12, defaultVal: '' },
        { name: '授信模式', code: 'productType', compType: '单选', isNeed: true, offset: 0, span: 24, defaultVal: '1', extra: { 选项: [{ value: '1', label: '产品授信（选择名称或编号后自动带出' }, { value: '2', label: '综合授信' }] } },
        { name: '产品编号', code: 'num', compType: '单行文本', isNeed: true, offset: 0, span: 8, defaultVal: '' },
        { name: '产品名称', code: 'name', compType: '单行文本', isNeed: true, offset: 0, span: 8, defaultVal: '' },
        { name: '产品额度', code: 'score', compType: '浮点数', isNeed: true, offset: 0, span: 8, defaultVal: 0, unit: '万元' },
        { name: '产品来源', code: 'num', compType: '单行文本', isNeed: true, offset: 0, span: 8, defaultVal: '' },
        { name: '还款方式', code: 'comType', compType: '多选', isNeed: true, offset: 0, span: 24, defaultVal: '', extra: { 字典类型: 'political' } },
        { name: '适用场景', code: 'comType', compType: '多选', isNeed: true, offset: 0, span: 24, defaultVal: '', extra: { 字典类型: 'political' } },
        { name: '放款账户', code: 'name', compType: '单行文本', isNeed: true, offset: 0, span: 12, defaultVal: '' },
        { name: '出票人', code: 'name', compType: '单行文本', isNeed: true, offset: 0, span: 12, defaultVal: '' },
        { name: '汇票开立', code: 'comType', compType: '多选', isNeed: true, offset: 0, span: 24, defaultVal: '', extra: { 字典类型: 'political' } },
        { name: '汇票交付', code: 'comType', compType: '多选', isNeed: true, offset: 0, span: 24, defaultVal: '', extra: { 字典类型: 'political' } },
        { name: '授信审批时间', code: 'score', compType: '整数', isNeed: true, offset: 0, span: 12, defaultVal: 0, unit: '日' },
        { name: '放款审批时间', code: 'score', compType: '整数', isNeed: true, offset: 0, span: 12, defaultVal: 0, unit: '日' },
        { name: '产品描述', code: 'remarks', compType: '多行文本', isNeed: false, offset: 0, span: 24, defaultVal: '', extra: { 行数: 5 } },
        { name: '产品特色', code: 'remarks', compType: '多行文本', isNeed: false, offset: 0, span: 24, defaultVal: '', extra: { 行数: 5 } },
        { name: '申请条件', code: 'remarks', compType: '多行文本', isNeed: false, offset: 0, span: 24, defaultVal: '', extra: { 行数: 5 } }
      ],
      formulas: []
    }
  },
  methods: {
    open () {
      this.$refs.dialog.open()
    },
    inputClick (t) {
      alert(JSON.stringify(t))
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
